Adding Standard Methods to a WS-AppServer Model |
|
When you import tables from the database (add classes), depending upon the tables selected, the attributes and standard methods are automatically generated. However, you can further add standard methods based on the data model that you want to create.
- Double-click the <WS-AppServer Package> from either of the following locations:
- Workspace Documents (My Recent Documents) window.
- Workspace Documents (Explorer) > <solution> > <project>. The WS-AppServer Package window appears, displaying the data models and their corresponding attributes, methods, and relations.
- In the Models group box, right-click a model and select Add > Standard Methods. The Add Standard Methods to Class dialog box appears.
- From the Select Attribute table, select the attributes for which you want to generate the standard methods. If you want to select all the attributes in the table, select the check box next to the table header.
- In the Object name used in the method field, provide a name for the object. The name you provide here is used by WS-AppServer to generate the methods. It is mandatory.
- Select the Do the selected attribute(s) uniquely identify an object? check box only if the selected attributes form a unique record and do not have duplication.
- Click OK.
The following four standard methods are generated and added to the Methods group box:
- get<objectname>Object
Note: The get<objectname>Object method is generated only if you have identified the attributes as unique (refer step 5). The variable <objectname> refers to the name that you provided (refer step 4). - get<objectname>Objects
- getPrevious<objectname>Objects
- getNext<objectname>Objects